package library.domain;

public class Book extends Entity {

    private String name;
    private String author;
    private Long size;
    private Byte[] content;
    private String extension;
    private String[] tags;
    private String description;

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public Byte[] getContent() {
        return content;
    }

    public void setContent(Byte[] content) {
        this.content = content;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getSize() {
        return size;
    }

    public void setSize(Long size) {
        this.size = size;
    }

    public String getExtension() {
        return extension;
    }

    public void setExtension(String extension) {
        this.extension = extension;
    }

    @Override
    public String toString() {
        return String.format("%d.%s.%s.%s", getId(), getAuthor(), getName(), getExtension());
    }

    public String[] getTags() {
        return tags;
    }

    public void setTags(String[] tags) {
        this.tags = tags;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getTagsAsString() {
        String sTags = "";
        if (this.getTags() != null) {
            for (String tag : this.getTags()) {
                sTags += tag + ";";
            }
        }
        return sTags;
    }
}
